#include<iostream>
using namespace std;
const int N = 1010;
int g[N][N];
int n;
bool st[N];
int dis[N];
void dij(int x)
{
	memset(dis, 0x3f, sizeof(dis));
	dis[x] = 0;
	for (int i = 0; i < n; i++) {
		int t = -1;
		for (int j = 1; j <= n; j++) {
			if (!st[j] && (t == -1 || dis[t] > dis[j])) {
				t=j;
			}
		}
		st[t] = 1;
		for (int j = 1; j <= n; j++) {
			dis[j] = min(dis[j], dis[t] + g[t][j]);
		}
	}
}
int main()
{
	
	return 0;
}